package homework.test01;

import java.util.LinkedHashMap;
import java.util.Scanner;
import java.util.function.BiConsumer;

public class demo06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        LinkedHashMap<Character, Integer> map = new LinkedHashMap<>();

        String str = sc.nextLine();
        System.out.println(str);
        char[] ch = str.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if(map.containsKey(ch[i])){
                map.put(ch[i],map.get(ch[i])+1);
            }else {
                map.put(ch[i],1);
            }
        }
        map.forEach((character, integer) -> System.out.print(character +"("+integer+")"));
    }
}
